#ifndef __XMLDISCOVER_HPP__
#define __XMLDISCOVER_HPP__




#include <string>
#include <vector>

#include "FieldNameLookup.hpp"


/*
  Given a targetURL to a YQL query result, fetch the XML data and produce an SQL CREATE statement
  that can be used to generate an SQL table to store that query result.
  Attempts to look up FieldNameType's for known FieldName's, otherwise defaults to 'text'
*/

class XMLDiscover 
{
public:
   XMLDiscover();
public:
   bool fetchPage(std::string targetURL);
   bool parseXMLData();
   bool buildSQLCreateTable();
public: // Accessors
   std::string       getURL()            { return this->strURL; }
   std::string       getXML()            { return this->strXML; }
   std::string       getSQLCreateTable() { return this->strSQLCreateTable; }
   bool              wasLastGetValid()   { return this->lastGetValid; }
   std::vector<std::string> vecNames;
private:
   std::string strURL;
   std::string strXML;
   std::string strSQLCreateTable;
   bool lastGetValid;
private:
   FieldNameLookup fieldNameLookup;
};



#endif




